const Koa = require("koa");
const bodyParser = require("koa-bodyparser");
const multer = require("koa-multer");

const app = new Koa();
const upload = multer();

app.use(bodyParser());

app.use(upload.any());

// json(raw) 格式
app.use((ctx, next) => {
  console.log(ctx.req.body);
  ctx.response.body = "Hello World";
});

app.listen(8000, () => {
  console.log("参数解析-json-urlencoded服务器启动成功");
});
